

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>飞前检查 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="软件包管理" href="../ceph-deploy-install/" />
    <link rel="prev" title="Ceph 部署" href="../" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../../">Ceph 存储集群</a> &raquo;</li>
        
          <li><a href="../">Ceph 部署</a> &raquo;</li>
        
      <li>飞前检查</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/rados/deployment/preflight-checklist.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../configuration/">配置</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../">部署</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">飞前检查</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id2">选装一个操作系统</a></li>
<li class="toctree-l4"><a class="reference internal" href="#ssh">安装 SSH 服务器</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">创建一用户</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">配置 SSH</a></li>
<li class="toctree-l4"><a class="reference internal" href="#ceph-deploy">安装 ceph-deploy</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">确认连通性</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-install/">安装 Ceph</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-new/">创建集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-mon/">增加/删除监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-keys/">密钥管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-osd/">增加/删除 OSD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-mds/">增加/删除 MDS</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-purge/">删减主机</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-admin/">管理任务</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../operations/">运维</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="id1">
<h1>飞前检查<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h1>
<div class="versionadded">
<p><span class="versionmodified added">New in version 0.60.</span></p>
</div>
<p>本篇<strong>飞前检查</strong>会协助你准备运行 <code class="docutils literal notranslate"><span class="pre">ceph-deploy</span></code> 的节点、和服务器节点，以使用无密码 <code class="docutils literal notranslate"><span class="pre">ssh</span></code> 和 <code class="docutils literal notranslate"><span class="pre">sudo</span></code> 。</p>
<p>通过 <code class="docutils literal notranslate"><span class="pre">ceph-deploy</span></code> 部署 Ceph 前，先要在管理节点和运行 Ceph 守护进程的节点上确认一些事情。</p>
<div class="section" id="id2">
<h2>选装一个操作系统<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<p>在各节点安装最新发布的 Debian 或 Ubuntu （如 16.04 LTS ），关于 Debian 或 Ubuntu 以外的操作系统详见<a class="reference external" href="../../../start/os-recommendations">操作系统推荐</a>。</p>
</div>
<div class="section" id="ssh">
<h2>安装 SSH 服务器<a class="headerlink" href="#ssh" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">ceph-deploy</span></code> 工具需要 <code class="docutils literal notranslate"><span class="pre">ssh</span></code> ，所以你的服务器节点需要
SSH 服务器。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">openssh</span><span class="o">-</span><span class="n">server</span>
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h2>创建一用户<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<p>在运行 Ceph 守护进程的节点上创建一个普通用户。</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>我们建议选一个暴力攻击者不可能轻易猜到的用户名，如
<code class="docutils literal notranslate"><span class="pre">root</span></code> 、 <code class="docutils literal notranslate"><span class="pre">ceph</span></code> 之外的名字。</p>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ssh</span> <span class="n">user</span><span class="nd">@ceph</span><span class="o">-</span><span class="n">server</span>
<span class="n">sudo</span> <span class="n">useradd</span> <span class="o">-</span><span class="n">d</span> <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">ceph</span> <span class="o">-</span><span class="n">m</span> <span class="n">ceph</span>
<span class="n">sudo</span> <span class="n">passwd</span> <span class="n">ceph</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">ceph-deploy</span></code> 会在节点安装软件包，所以你创建的用户需要无密码 <code class="docutils literal notranslate"><span class="pre">sudo</span></code> 权限。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>为安全起见，我们<strong>不推荐</strong>启用 <code class="docutils literal notranslate"><span class="pre">root</span></code> 密码。</p>
</div>
<p>为赋予用户所有权限，把下列加入 <code class="docutils literal notranslate"><span class="pre">/etc/sudoers.d/ceph</span></code> 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">echo</span> <span class="s2">&quot;ceph ALL = (root) NOPASSWD:ALL&quot;</span> <span class="o">|</span> <span class="n">sudo</span> <span class="n">tee</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">sudoers</span><span class="o">.</span><span class="n">d</span><span class="o">/</span><span class="n">ceph</span>
<span class="n">sudo</span> <span class="n">chmod</span> <span class="mi">0440</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">sudoers</span><span class="o">.</span><span class="n">d</span><span class="o">/</span><span class="n">ceph</span>
</pre></div>
</div>
</div>
<div class="section" id="id4">
<h2>配置 SSH<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<p>配置你的管理主机，使之可通过  SSH无密码访问各节点，口令留空。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ssh</span><span class="o">-</span><span class="n">keygen</span>
<span class="n">Generating</span> <span class="n">public</span><span class="o">/</span><span class="n">private</span> <span class="n">key</span> <span class="n">pair</span><span class="o">.</span>
<span class="n">Enter</span> <span class="n">file</span> <span class="ow">in</span> <span class="n">which</span> <span class="n">to</span> <span class="n">save</span> <span class="n">the</span> <span class="n">key</span> <span class="p">(</span><span class="o">/</span><span class="n">ceph</span><span class="o">-</span><span class="n">client</span><span class="o">/.</span><span class="n">ssh</span><span class="o">/</span><span class="n">id_rsa</span><span class="p">):</span>
<span class="n">Enter</span> <span class="n">passphrase</span> <span class="p">(</span><span class="n">empty</span> <span class="k">for</span> <span class="n">no</span> <span class="n">passphrase</span><span class="p">):</span>
<span class="n">Enter</span> <span class="n">same</span> <span class="n">passphrase</span> <span class="n">again</span><span class="p">:</span>
<span class="n">Your</span> <span class="n">identification</span> <span class="n">has</span> <span class="n">been</span> <span class="n">saved</span> <span class="ow">in</span> <span class="o">/</span><span class="n">ceph</span><span class="o">-</span><span class="n">client</span><span class="o">/.</span><span class="n">ssh</span><span class="o">/</span><span class="n">id_rsa</span><span class="o">.</span>
<span class="n">Your</span> <span class="n">public</span> <span class="n">key</span> <span class="n">has</span> <span class="n">been</span> <span class="n">saved</span> <span class="ow">in</span> <span class="o">/</span><span class="n">ceph</span><span class="o">-</span><span class="n">client</span><span class="o">/.</span><span class="n">ssh</span><span class="o">/</span><span class="n">id_rsa</span><span class="o">.</span><span class="n">pub</span><span class="o">.</span>
</pre></div>
</div>
<p>把公钥拷贝到各节点：
:</p>
<blockquote>
<div><p>ssh-copy-id <a class="reference external" href="mailto:ceph&#37;&#52;&#48;ceph-server">ceph<span>&#64;</span>ceph-server</a></p>
</div></blockquote>
<p>修改你管理节点上的 <code class="docutils literal notranslate"><span class="pre">~/.ssh/config</span></code> ，以使未指定用户名时默认用你刚刚创建的用户名。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Host</span> <span class="n">ceph</span><span class="o">-</span><span class="n">server</span>
        <span class="n">Hostname</span> <span class="n">ceph</span><span class="o">-</span><span class="n">server</span><span class="o">.</span><span class="n">fqdn</span><span class="o">-</span><span class="ow">or</span><span class="o">-</span><span class="n">ip</span><span class="o">-</span><span class="n">address</span><span class="o">.</span><span class="n">com</span>
        <span class="n">User</span> <span class="n">ceph</span>
</pre></div>
</div>
</div>
<div class="section" id="ceph-deploy">
<h2>安装 ceph-deploy<a class="headerlink" href="#ceph-deploy" title="Permalink to this headline">¶</a></h2>
<p>执行下列命令安装 <code class="docutils literal notranslate"><span class="pre">ceph-deploy</span></code> ：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>wget -q -O- &#39;https://download.ceph.com/keys/release.asc&#39; | sudo apt-key add -
echo deb https://download.ceph.com/debian-nautilus/ $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list
sudo apt-get update
sudo apt-get install ceph-deploy
</pre></div>
</div>
</div>
<div class="section" id="id5">
<h2>确认连通性<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p>确保你的管理节点网络连接正常、且能连接服务器节点（如确认 <code class="docutils literal notranslate"><span class="pre">iptables</span></code> 、 <code class="docutils literal notranslate"><span class="pre">ufw</span></code> 或其它可阻断连接的工具、流量转发等等这些组件配置正常）。</p>
<p>完成飞前检查后，你就可以开始用 <code class="docutils literal notranslate"><span class="pre">ceph-deploy</span></code> 部署了。</p>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../ceph-deploy-install/" class="btn btn-neutral float-right" title="软件包管理" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../" class="btn btn-neutral float-left" title="Ceph 部署" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>